<!--********************************************************************
* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
*********************************************************************-->
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <title data-i18n="resources.title_componentsDemo_Vue"></title>
        <script type="text/javascript" include="vue" src="../js/include-web.js"></script>
        <script
            include="echarts-vue,ant-design-vue,iclient-mapboxgl-vue,mapbox-gl-enhance,ant-design-vue"
            src="../../dist/mapboxgl/include-mapboxgl.js"
        ></script>
        <style>
            #main {
                margin: 0 auto;
                width: 100%;
                height: 100vh;
                overflow: hidden;
                padding-left: 2.08vw;
                box-sizing: border-box;
            }

            @media screen and (max-width: 992px) {
                #main {
                    overflow: auto;
                }
            }

            @media screen and (max-height: 640px) {
                #main {
                    overflow: auto;
                }
            }

            /* #contentText {
      position: absolute;
      width: 490px;
      height: 130px;
      top: 180px;
      left: 60px;
    } */
        </style>
    </head>

    <body style="margin: 0;background: #fff;">
        <div id="main">
            <a-row>
                <a-col :md="8" class="left-container">
                    <a-row v-if="!showMap">
                        <div class="map-wrap">
                            <sm-web-map server-url="https://www.supermapol.com" map-id="2068226677">
                                <sm-zoom></sm-zoom>
                                <sm-scale position="bottom-left"></sm-scale>
                            </sm-web-map>
                        </div>
                    </a-row>
                    <a-row class="title-text-wrap">
                        <sm-text
                            id="titleText"
                            :font-style="titleFontStyle"
                            text-color="#5AB1EF"
                            title="国土空间规划实时监测评估预警"
                        ></sm-text>
                    </a-row>

                    <a-row class="time-text-wrap">
                        <sm-time-text
                            id="timeText"
                            :font-style='{"fontFamily": "微软雅黑"}'
                            text-color="#B7B2B2"
                            time-type="date+second+week"
                        ></sm-time-text>
                    </a-row>

                    <a-row class="monitor-wrap">
                        <a-row class="block-title">
                            <sm-text id="monitoringText" :font-style="categoryFontStyle" title="监测情况"></sm-text>
                        </a-row>
                        <a-row class="monitor-text">
                            <sm-text
                                id="contentText"
                                :font-style='{"fontFamily": "微软雅黑","fontWeight": "bolder","textAlign": "left"}'
                                text-color="#807B7B"
                                title="截止2018年底，国土空间整体开发强度为2.5%，三类空间比例为50%:30%:20%。耕地保有量为300万亩，城镇建设用地规模为300km²，森林覆盖率达到64%，水功能水质达标率为80%，生态环境治理良好。"
                            >
                            </sm-text>
                        </a-row>
                    </a-row>

                    <a-row class="control-wrap">
                        <a-row class="block-title">
                            <sm-text id="sanxianText" :font-style="categoryFontStyle" title="三线管控"></sm-text>
                        </a-row>
                        <a-row type="flex" justify="space-around">
                            <a-col :md="8" :sm="6" :xs="6" class="control-title">
                                <sm-text id="ecologyText" :font-style="textFontStyle" title="生态空间"></sm-text>
                                <sm-liquid-fill
                                    id="liquidFill1"
                                    :value="0.32"
                                    :font-size="18"
                                    :wave-count="2"
                                    :wave-animation="true"
                                    wave-color="#2EC7C9"
                                >
                                </sm-liquid-fill>
                            </a-col>
                            <a-col :md="8" :sm="6" :xs="6" class="control-title">
                                <sm-text id="townText" :font-style="textFontStyle" title="城镇空间"></sm-text>
                                <sm-liquid-fill
                                    id="liquidFill2"
                                    :value="0.48"
                                    :font-size="18"
                                    :wave-count="2"
                                    :wave-animation="true"
                                    wave-color="#ffb980"
                                >
                                </sm-liquid-fill>
                            </a-col>
                            <a-col :md="8" :sm="6" :xs="6" class="control-title">
                                <sm-text id="farmText" :font-style="textFontStyle" title="农业空间"></sm-text>
                                <sm-liquid-fill
                                    id="liquidFill3"
                                    :value="0.17"
                                    :font-size="18"
                                    :wave-count="3"
                                    :wave-animation="true"
                                    wave-color="#d87a80"
                                >
                                </sm-liquid-fill>
                            </a-col>
                        </a-row>
                    </a-row>

                    <a-row class="resource-wrap">
                        <a-row class="block-title">
                            <sm-text id="naturalText" :font-style="categoryFontStyle" title="自然资源"></sm-text>
                        </a-row>
                        <a-row type="flex" justify="end" class="resource-year">
                            <a-col :md="9" :sm="8" :xs="8">
                                <sm-text id="yearText1" :font-style="textFontStyle" title="2017年"></sm-text>
                            </a-col>
                            <a-col :md="9" :sm="8" :xs="8">
                                <sm-text id="yearText2" :font-style="textFontStyle" title="2018年"></sm-text>
                            </a-col>
                        </a-row>
                        <a-row type="flex" align="middle" class="resource-item">
                            <a-col :md="6" :sm="8" :xs="8">
                                <sm-indicator
                                    id="woodlandIndicator"
                                    title="林地保有量"
                                    unit="km²"
                                    num="300"
                                    font-size="26"
                                ></sm-indicator>
                            </a-col>
                            <a-col :md="18" :sm="16" :xs="16" class="resource-chart">
                                <a-col :md="12" :sm="12" :xs="12">
                                    <div class="sm-progress-wrap">
                                        <sm-progress
                                            id="progress5"
                                            size="100"
                                            stroke-color="#b6a2de"
                                            percent="30"
                                            stroke-width="6"
                                            type="circle"
                                        >
                                        </sm-progress>
                                    </div>
                                </a-col>
                                <a-col :md="12" :sm="12" :xs="12">
                                    <div class="sm-progress-wrap">
                                        <sm-progress
                                            id="progress6"
                                            size="100"
                                            stroke-color="#5ab1ef"
                                            percent="50"
                                            stroke-width="6"
                                            type="circle"
                                        >
                                        </sm-progress>
                                    </div>
                                </a-col>
                            </a-col>
                        </a-row>
                        <a-row type="flex" align="middle" class="resource-item">
                            <a-col :md="6" :sm="8" :xs="8">
                                <sm-indicator
                                    id="farmlandIndicator"
                                    title="耕地保有量"
                                    unit="万亩"
                                    num="300"
                                    font-size="26"
                                ></sm-indicator>
                            </a-col>
                            <a-col :md="18" :sm="16" :xs="16" class="resource-chart">
                                <a-col :md="12" :sm="12" :xs="12">
                                    <div class="sm-progress-wrap">
                                        <sm-progress
                                            id="progress7"
                                            size="100"
                                            stroke-color="#2ec7c9"
                                            percent="60"
                                            stroke-width="6"
                                            type="circle"
                                        >
                                        </sm-progress>
                                    </div>
                                </a-col>
                                <a-col :md="12" :sm="12" :xs="12">
                                    <div class="sm-progress-wrap">
                                        <sm-progress
                                            id="progress8"
                                            size="100"
                                            stroke-color="#ffb980"
                                            percent="80"
                                            stroke-width="6"
                                            type="circle"
                                        >
                                        </sm-progress>
                                    </div>
                                </a-col>
                            </a-col>
                        </a-row>
                    </a-row>
                </a-col>

                <a-col :md="16" :xs="24">
                    <a-row v-if="showMap">
                        <div class="map-wrap">
                            <sm-web-map server-url="https://www.supermapol.com" map-id="2068226677">
                                <sm-zoom></sm-zoom>
                                <sm-scale position="bottom-left"></sm-scale>
                            </sm-web-map>
                        </div>
                    </a-row>

                    <a-row>
                        <a-col :md="12" :xs="24" class="environment-wrap">
                            <a-row class="environment-title block-title">
                                <sm-icon id="icon1" icon-class="marker-layer" size="18" color="red"></sm-icon>
                                <sm-text id="ecologicalText" :font-style="categoryFontStyle" title="生态环境"></sm-text>
                            </a-row>
                            <a-row class="environment-progress-holder">
                                <a-col class="progress-col" :md="24" :xs="24">
                                    <sm-progress
                                        id="progress1"
                                        stroke-color="#2ec7c9"
                                        percent="80"
                                        stroke-width="10"
                                        type="line"
                                    ></sm-progress>
                                </a-col>
                                <a-col class="progress-col" :md="24" :xs="24">
                                    <sm-progress
                                        id="progress2"
                                        stroke-color="#ffb980"
                                        percent="40"
                                        stroke-width="10"
                                        type="line"
                                    ></sm-progress>
                                </a-col>
                                <a-col class="progress-col" :md="24" :xs="24">
                                    <sm-progress
                                        id="progress3"
                                        stroke-color="#b6a2de"
                                        percent="60"
                                        stroke-width="10"
                                        type="line"
                                    ></sm-progress>
                                </a-col>
                                <a-col class="progress-col" :md="24" :xs="24">
                                    <sm-progress
                                        id="progress4"
                                        stroke-color="#5ab1ef"
                                        percent="20"
                                        stroke-width="10"
                                        type="line"
                                    ></sm-progress>
                                </a-col>
                            </a-row>
                        </a-col>

                        <a-col :md="12" :xs="24" class="chart-wrap">
                            <a-row class="chart-title block-title">
                                <sm-icon id="icon2" icon-class="marker-layer" size="18" color="#2EC7C9"></sm-icon>
                                <sm-text
                                    id="developmentText"
                                    :font-style="categoryFontStyle"
                                    title="开发利用"
                                ></sm-text>
                            </a-row>
                            <a-row>
                                <a-col :md="24" :xs="24">
                                    <sm-chart
                                        icon-class=""
                                        :options="echartOption"
                                        :dataset="dataset"
                                        :dataset-options="datasetOptions"
                                    >
                                    </sm-chart>
                                </a-col>
                            </a-row>
                        </a-col>
                    </a-row>
                </a-col>
            </a-row>
        </div>

        <script>
            //本示例数据纯属虚构
            new Vue({
                el: '#main',
                data() {
                    return {
                        dataset: {
                            type: 'iPortal', //iServer iPortal
                            url: 'https://iportal.supermap.io/iportal/web/datas/975651597',
                            queryInfo: {
                                maxFeatures: 20
                            }
                        },
                        datasetOptions: [
                            {
                                seriesType: 'bar', //图表类型
                                isStastic: true, //是否统计, 默认不统计
                                xField: '机场', //x坐标轴数据字段
                                yField: 'COL_2016起降架次（架次）' //统计的数据，legned默认名字
                            },
                            {
                                seriesType: 'bar', //图表类型
                                isStastic: true, //是否统计, 默认不统计
                                xField: '机场', //x坐标轴数据字段
                                yField: 'COL_2017起降架次（架次）' //统计的数据，legned默认名字
                            }
                        ],
                        echartOption: {
                            legend: { data: ['COL_2017起降架次（架次）', 'COL_2016起降架次（架次）'] }, //与 yField数据一致
                            grid: {
                                top: 30,
                                bottom: 65,
                                left: 55,
                                right: 40
                            }
                        },
                        titleFontStyle: {
                            fontFamily: '微软雅黑',
                            fontWeight: 'bolder'
                        },
                        categoryFontStyle: {
                            fontFamily: '微软雅黑',
                            fontWeight: 'bolder',
                            textAlign: 'left'
                        },
                        textFontStyle: {
                            fontFamily: '微软雅黑',
                            fontWeight: 'bolder',
                            textAlign: 'center'
                        },
                        showMap: true
                    };
                },
                mounted() {
                    let screenWidth = document.body.clientWidth;
                    if (screenWidth <= 540) {
                        this.showMap = false;
                    }
                }
            });
        </script>
        <style>
            html {
                font-size: 10px;
            }

            .left-container {
                padding-top: 2.2vh;
                padding-right: 1.2vw;
            }

            .map-wrap {
                height: 63vh;
            }
            #titleText {
                font-size: 2rem;
            }
            .title-text-wrap .sm-component-text {
                width: 100%;
                font-size: 1.6rem;
                line-height: 1.5;
            }

            .time-text-wrap .sm-component-time-text {
                text-align: center;
                display: block;
                margin: 0 auto;
                font-size: 1.2rem;
            }

            .block-title .sm-component-text {
                width: 100%;
                font-size: 1.4rem;
                line-height: 1.5;
            }

            .monitor-wrap {
                margin: 0.93vh 0;
            }

            .monitor-wrap .block-title {
                margin-bottom: 1.85vh;
            }

            .monitor-wrap .monitor-text .sm-component-text {
                width: 100%;
                font-size: 1.1rem;
                line-height: 1.5;
            }

            .control-wrap .block-title,
            .resource-wrap .block-title {
                /* margin-bottom: 1.2vh; */
                padding-top: 2.78vh;
            }

            .control-wrap .control-title .sm-component-liquidFill {
                height: 13.89vh;
            }

            .control-wrap .control-title .sm-component-text,
            .resource-wrap .resource-year .sm-component-text {
                width: 100%;
                margin-bottom: 0.93vh;
                font-size: 1.1rem;
            }

            .resource-wrap .resource-item {
                margin-bottom: 3.2vh;
            }

            .resource-wrap .resource-item:last-of-type {
                margin-bottom: 0;
            }

            .resource-wrap .resource-item .sm-component-indicator .sm-component-indicator__title,
            .resource-wrap .resource-item .sm-component-indicator .sm-component-indicator__unit {
                font-size: 1rem;
                line-height: 1.5;
            }

            .resource-wrap .resource-item .sm-component-indicator .sm-component-indicator__num {
                font-size: 1.5rem;
            }

            .resource-wrap .resource-item .sm-component-indicator .sm-component-indicator__content {
                margin-bottom: 0;
                margin-right: 0;
            }

            .resource-wrap .resource-chart .sm-component-progress-wrap {
                height: 12.96vh;
            }

            .resource-wrap .resource-chart .sm-component-progress {
                text-align: center;
            }

            .environment-wrap {
                padding-right: 6.77vw;
            }

            .environment-wrap .environment-title .sm-component-icon,
            .environment-wrap .environment-title .sm-component-text,
            .chart-wrap .chart-title .sm-component-icon,
            .chart-wrap .chart-title .sm-component-text {
                width: auto;
                display: inline-block;
                vertical-align: middle;
            }

            .environment-wrap .environment-title,
            .chart-wrap .chart-title {
                padding-top: 0.93vh;
            }

            .environment-wrap .environment-title {
                margin-bottom: 2.78vh;
            }

            .environment-wrap,
            .environment-progress-holder .progress-col {
                margin-bottom: 3.7vh;
            }

            .environment-wrap,
            .environment-progress-holder .progress-col:last-child {
                margin-bottom: 0;
            }

            .chart-wrap .chart-title {
                margin-bottom: 1.39vh;
            }

            .chart-wrap .sm-component-chart {
                height: 30vh;
            }
            .sm-component-chart .sm-component-card__content {
                box-shadow: 0 0 0 #fff;
                width: 100%;
                height: 28vh;
            }
            @media (max-width: 540px) {
                html {
                    font-size: 10px;
                }
                .left-container {
                    padding-top: 0;
                }
                .map-wrap {
                    margin-left: -2.08vw;
                    width: 100vw;
                    height: 90vh;
                }
            }
            @media (min-width: 1200px) {
                html {
                    font-size: 16px;
                }
            }
        </style>
    </body>
</html>
